package com.example.demo.common.entity.response;

/**
 * 返回结果码，名称前缀用模块名.
 *
 * @author Mei Ruoxiao
 * @see ResultCode
 * @since 2020/8/24
 */
public class ResCode extends ResultCode {
    // COMPANY  E01000-E01999
    // 登录与注册

    public static final ResultCode COMPANY_USER_NOT_EXIST = of("E01001", "用户不存在");
    public static final ResultCode COMPANY_FAIL_EXEC_COMPANY_SWITCH = of("E01002", "切换企业失败");
    public static final ResultCode COMPANY_LOGIN_TIMEOUT = of("E01003", "登录超时,请重新登录");
    public static final ResultCode COMPANY_CODE_INVALID = of("E01004", "验证码已失效，请重新发送验证码");
    public static final ResultCode COMPANY_CODE_ERROR = of("E01005", "验证码有误");
    public static final ResultCode COMPANY_PARAM_TYPE_ERROR = of("E01006", "type参数有误");
    public static final ResultCode COMPANY_PASSWORD_ERROR = of("E01007", "密码错误");
    public static final ResultCode COMPANY_LOGIN_KEY_TIMEOUT = of("E01008", "登录已超时，请重新登录");
    public static final ResultCode COMPANY_TEL_IS_INVALID = of("E01009", "无效的电话号码");

    //REPOSITORY E02000-E02999
    //仓库管理

    public static final ResultCode REPOSITORY_NAME_NOT_EMPTY = of("E02001", "文件夹名称不能为空");
    public static final ResultCode REPOSITORY_NAME_LENGTH_NOT_EXIST = of("E02002", "文件夹名称不超过50个字符");
    public static final ResultCode REPOSITORY_NAME_DUPLICATE = of("E02003", "文件夹名称重复");
    public static final ResultCode REPOSITORY_NOT_EXIST = of("E02004", "文件夹不存在");
    public static final ResultCode REPOSITORY_PARENT_NOT_EXIST = of("E02005", "父文件夹不存在");
    public static final ResultCode REPOSITORY_ROOT_NOT_ALLOWED_DELETE = of("E02006", "根文件夹不允许删除");
    public static final ResultCode REPOSITORY_EXIST_SUBFOLDER = of("E02007", "当前文件夹下存在子文件夹，不允许删除");
    public static final ResultCode REPOSITORY_EXIST_FILE = of("E02008", "当前文件夹下存在子文件，不允许删除");
    public static final ResultCode REPOSITORY_ROOT_NOT_ALLOWED_UPDATE = of("E02009", "根文件夹不允许修改名称");
    public static final ResultCode REPOSITORY_NOT_ENOUGH_STOCK = of("E02010", "库存数不足，请重新选择");


    //SUPPLIER E03000-E03999
    //供应商

    public static final ResultCode SUPPLIER_BANK_NUM__IS_INVALID = of("E03001", "无效的银行卡号");
    public static final ResultCode SUPPLIER_BANK_NAME__ERROR = of("E03002", "银行卡所属银行错误");

    private String code;
    private String desc;

    private ResCode(final String code, final String desc) {
        super(code, desc);
        super.code = code;
        super.desc = desc;
    }

    public static ResultCode of(final String code, final String desc) {
        return new ResultCode(code, desc);
    }
}
